package com.hfzy.ihk.common.core.freeswitch.robot.support;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/9/26.
 *
 * @author wws
 */
public enum EventName {

    CUSTOM("自定义"),
    HEARTBEAT("心跳"),
    DTMF("双音多频键信息"),

    ADD_SCHEDULE(""),
    API(""),
    BACKGROUND_JOB(""),
    CALL_DETAIL(""),
    CALL_SECURE(""),
    CALL_SETUP_REQ(""),
    CALL_UPDATE(""),
    CDR(""),

    CHANNEL_ANSWER(""),
    CHANNEL_APPLICATION(""),
    CHANNEL_BRIDGE(""),
    CHANNEL_CALLSTATE(""),
    CHANNEL_CREATE(""),
    CHANNEL_DATA(""),
    CHANNEL_DESTROY(""),
    CHANNEL_EXECUTE(""),
    CHANNEL_EXECUTE_COMPLETE(""),
    CHANNEL_GLOBAL(""),
    CHANNEL_HANGUP(""),
    CHANNEL_HANGUP_COMPLETE(""),
    CHANNEL_HOLD(""),
    CHANNEL_ORIGINATE(""),
    CHANNEL_OUTGOING(""),
    CHANNEL_PARK(""),
    CHANNEL_PROGRESS("用户开始振铃"),
    CHANNEL_PROGRESS_MEDIA(""),
    CHANNEL_STATE(""),
    CHANNEL_UNBRIDGE(""),
    CHANNEL_UNHOLD(""),
    CHANNEL_UNPARK(""),
    CHANNEL_UUID(""),

    CLONE(""),
    CODEC(""),
    COMMAND(""),
    CONFERENCE_DATA(""),
    CONFERENCE_DATA_QUERY(""),
    DEL_SCHEDULE(""),

    DETECTED_SPEECH(""),

    DETECTED_TONE(""),
    DEVICE_STATE(""),
    EXE_SCHEDULE(""),
    FAILURE(""),
    GENERAL(""),
    LOG(""),

    MEDIA_BUG_START(""),
    MEDIA_BUG_STOP(""),

    MESSAGE(""),
    MESSAGE_QUERY(""),
    MESSAGE_WAITING(""),

    MODULE_LOAD(""),
    MODULE_UNLOAD(""),
    NAT(""),
    NOTALK(""),
    NOTIFY(""),
    NOTIFY_IN(""),
    PHONE_FEATURE(""),
    PHONE_FEATURE_SUBSCRIBE(""),

    PLAYBACK_START(""),
    PLAYBACK_STOP(""),

    PRESENCE_IN(""),
    PRESENCE_OUT(""),
    PRESENCE_PROBE(""),
    PRIVATE_COMMAND(""),
    PUBLISH(""),
    QUEUE_LEN(""),

    RECORD_START(""),
    RECORD_STOP(""),

    RECV_INFO(""),
    RECV_MESSAGE(""),
    RECV_RTCP_MESSAGE(""),
    RECYCLE(""),
    RELOADXML(""),
    REQUEST_PARAMS(""),
    RE_SCHEDULE(""),
    ROSTER(""),

    SEND_INFO(""),
    SEND_MESSAGE(""),
    SESSION_HEARTBEAT(""),

    SHUTDOWN(""),
    STARTUP(""),

    SUBCLASS_ANY(""),
    TALK(""),
    TRAP(""),
    UNPUBLISH("");

    private String desc;

    public String getDesc() {
        return desc;
    }

    EventName(String desc) {
        this.desc = desc;
    }

    private static Map<String,EventName> dataMap = new HashMap<>();

    static {

        for(EventName ev:EventName.values()){
            dataMap.put(ev.name(),ev);
        }
    }

    public static EventName fromName(String name){

        return dataMap.get(name);
    }
}
